import request from "@/utils/request";

// 查询试卷题目关联列表
export function listExam_question(query) {
  return request({
    url: "/system/exam_question/list",
    method: "get",
    params: query,
  });
}

// 查询试卷题目关联详细
export function getExam_question(examId) {
  return request({
    url: "/system/exam_question/" + examId,
    method: "get",
  });
}

// 新增试卷题目关联
export function addExam_question(data) {
  return request({
    url: "/system/exam_question",
    method: "post",
    data: data,
  });
}

// 修改试卷题目关联
export function updateExam_question(data) {
  return request({
    url: "/system/exam_question",
    method: "put",
    data: data,
  });
}

// 删除试卷题目关联
export function delExam_question(examId) {
  return request({
    url: "/system/exam_question/" + examId,
    method: "delete",
  });
}

export function fetchExamQuestionsByExamId(examId) {
  return request({
    url: `/system/exam_question/questions/${examId}`,
    method: 'get'
  });
}

export function updateExamQuestions(data) {
  return request({
    url: '/system/exam_question/addbatch',
    method: 'post',
    data
  });
}
